# -*- coding: utf-8 -*-

###################################################
# LOCAL import
###################################################
from Plugins.Extensions.IPTVPlayer.components.iptvplayerinit import TranslateTXT as _, SetIPTVPlayerLastHostError, GetIPTVNotify
from Plugins.Extensions.IPTVPlayer.tools.iptvtools import printDBG, GetTmpDir, GetCookieDir
from Plugins.Extensions.IPTVPlayer.libs.pCommon import common
from Plugins.Extensions.IPTVPlayer.components.asynccall import MainSessionWrapper
from Plugins.Extensions.IPTVPlayer.components.hcaptcha_v2widget import UnCaptchahCaptchaWidget
from Plugins.Extensions.IPTVPlayer.libs import ph
from Plugins.Extensions.IPTVPlayer.libs.e2ijson import loads as json_loads, dumps as json_dumps

###################################################
# FOREIGN import
###################################################
import urllib.parse
import re
from urllib.parse import urlparse
import html.parser
import time
###################################################


class UnCaptchahCaptcha:
    def __init__(self, lang='en', params={}):
        self.cm = common()
        self.sessionEx = MainSessionWrapper()
        self.params = params

        if not params:
            self.HTTP_HEADER = {'Accept-Language': lang, 'Referer': 'https://assets.hcaptcha.com', 'User-Agent': 'Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.18) Gecko/20110621 Mandriva Linux/1.9.2.18-0.1mdv2010.2 (2010.2) Firefox/3.6.18'}
            self.COOKIE_FILE = GetCookieDir('hcaptcha.cookie')
            self.params = {'with_metadata': True, 'use_cookie': True, 'save_cookie': True, 'load_cookie': True, 'cookiefile': self.COOKIE_FILE, 'header': self.HTTP_HEADER}

    def processCaptcha(self, challenge_form, referer, lang='en', params={}):
        post_data = None
        token = ''
        iteration = 0

        if not params:
            self.HTTP_HEADER = {'Accept-Language': lang, 'Referer': 'https://assets.hcaptcha.com', 'User-Agent': 'Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.18) Gecko/20110621 Mandriva Linux/1.9.2.18-0.1mdv2010.2 (2010.2) Firefox/3.6.18'}
            self.COOKIE_FILE = GetCookieDir('hcaptcha.cookie')
            self.params = {'with_metadata': True, 'use_cookie': True, 'save_cookie': True, 'load_cookie': True, 'cookiefile': self.COOKIE_FILE, 'header': self.HTTP_HEADER}

        if referer:
            self.params['header']['Referer'] = referer

        # printDBG(challenge_form)

        action = re.findall('action="([^"]+?)"', challenge_form)[0]
        key = re.findall('data-sitekey="([^"]+?)"', challenge_form)[0]
        dataray = re.findall('data-ray="([^"]+?)"', challenge_form)[0]
        scriptUrl = re.findall('<script.*src="([^"]+?)"', challenge_form)[0]

        # printDBG("%s %s %s %s" % (action, key, dataray, scriptUrl))

        hCaptcha = {}
        hCaptcha.update({'action': action, 'sitekey': key, 'dataray': dataray, 'scriptUrl': scriptUrl})
        hCaptcha['domain'] = urlparse(referer).netloc

        # get hcaptcha challenge items

        postData = {
            'sitekey': key,
            'host': referer,
            'hl': lang,
            # 'motionData': '%7B%22st%22%3A1588533093455%2C%22mm%22%3A%5B%5B116%2C10%2C1588533094082%5D%2C%5B136%2C29%2C1588533094087%5D%2C%5B158%2C51%2C1588533094095%5D%2C%5B181%2C73%2C1588533094103%5D%2C%5B147%2C71%2C1588533165366%5D%2C%5B143%2C65%2C1588533165374%5D%2C%5B138%2C58%2C1588533165382%5D%2C%5B134%2C51%2C1588533165391%5D%2C%5B128%2C44%2C1588533165398%5D%2C%5B123%2C38%2C1588533165406%5D%2C%5B118%2C33%2C1588533165414%5D%2C%5B112%2C28%2C1588533165423%5D%2C%5B107%2C25%2C1588533165431%5D%2C%5B102%2C22%2C1588533165439%5D%2C%5B97%2C19%2C1588533165447%5D%2C%5B92%2C17%2C1588533165455%5D%2C%5B88%2C15%2C1588533165463%5D%2C%5B84%2C14%2C1588533165471%5D%2C%5B79%2C13%2C1588533165479%5D%2C%5B74%2C11%2C1588533165487%5D%2C%5B69%2C10%2C1588533165495%5D%2C%5B64%2C9%2C1588533165503%5D%2C%5B61%2C9%2C1588533165511%5D%2C%5B57%2C9%2C1588533165519%5D%2C%5B52%2C9%2C1588533165527%5D%2C%5B47%2C10%2C1588533165535%5D%2C%5B43%2C11%2C1588533165543%5D%2C%5B39%2C13%2C1588533165551%5D%2C%5B35%2C14%2C1588533165559%5D%2C%5B33%2C15%2C1588533165567%5D%2C%5B31%2C17%2C1588533165575%5D%2C%5B29%2C19%2C1588533165583%5D%2C%5B28%2C21%2C1588533165591%5D%2C%5B27%2C24%2C1588533165598%5D%2C%5B26%2C27%2C1588533165607%5D%2C%5B26%2C28%2C1588533165615%5D%2C%5B26%2C31%2C1588533165623%5D%2C%5B26%2C33%2C1588533165631%5D%2C%5B26%2C35%2C1588533165639%5D%2C%5B26%2C37%2C1588533165647%5D%2C%5B26%2C38%2C1588533165655%5D%2C%5B26%2C39%2C1588533165663%5D%2C%5B26%2C40%2C1588533165671%5D%2C%5B27%2C41%2C1588533165719%5D%2C%5B28%2C41%2C1588533165767%5D%2C%5B29%2C41%2C1588533165791%5D%2C%5B30%2C41%2C1588533165999%5D%2C%5B31%2C41%2C1588533166007%5D%2C%5B32%2C41%2C1588533166031%5D%5D%2C%22md%22%3A%5B%5B32%2C41%2C1588533166051%5D%5D%2C%22mu%22%3A%5B%5B32%2C41%2C1588533166186%5D%5D%2C%22topLevel%22%3A%7B%22st%22%3A1588533093169%2C%22sc%22%3A%7B%22availWidth%22%3A1313%2C%22availHeight%22%3A744%2C%22width%22%3A1366%2C%22height%22%3A768%2C%22colorDepth%22%3A24%2C%22pixelDepth%22%3A24%2C%22availLeft%22%3A53%2C%22availTop%22%3A24%7D%2C%22nv%22%3A%7B%22vendorSub%22%3A%22%22%2C%22productSub%22%3A%2220030107%22%2C%22vendor%22%3A%22Google%20Inc.%22%2C%22maxTouchPoints%22%3A0%2C%22hardwareConcurrency%22%3A4%2C%22cookieEnabled%22%3Atrue%2C%22appCodeName%22%3A%22Mozilla%22%2C%22appName%22%3A%22Netscape%22%2C%22appVersion%22%3A%225.0%20(X11%3B%20Linux%20x86_64)%20AppleWebKit%2F537.36%20(KHTML%2C%20like%20Gecko)%20Chrome%2F80.0.3987.106%20Safari%2F537.36%22%2C%22platform%22%3A%22Linux%20x86_64%22%2C%22product%22%3A%22Gecko%22%2C%22userAgent%22%3A%22Mozilla%2F5.0%20(X11%3B%20Linux%20x86_64)%20AppleWebKit%2F537.36%20(KHTML%2C%20like%20Gecko)%20Chrome%2F80.0.3987.106%20Safari%2F537.36%22%2C%22language%22%3A%22it-IT%22%2C%22languages%22%3A%5B%22it-IT%22%2C%22it%22%2C%22en-US%22%2C%22en%22%2C%22pt%22%2C%22pl%22%2C%22de%22%2C%22ru%22%2C%22es%22%2C%22fr%22%2C%22nl%22%2C%22sl%22%2C%22bs%22%2C%22hu%22%2C%22da%22%2C%22cs%22%2C%22ar%22%2C%22hr%22%2C%22ro%22%2C%22be%22%2C%22ca%22%2C%22he%22%2C%22no%22%5D%2C%22onLine%22%3Atrue%2C%22doNotTrack%22%3Anull%2C%22geolocation%22%3A%7B%7D%2C%22mediaCapabilities%22%3A%7B%7D%2C%22connection%22%3A%7B%7D%2C%22webkitTemporaryStorage%22%3A%7B%7D%2C%22webkitPersistentStorage%22%3A%7B%7D%2C%22userActivation%22%3A%7B%7D%2C%22mediaSession%22%3A%7B%7D%2C%22permissions%22%3A%7B%7D%2C%22deviceMemory%22%3A4%2C%22clipboard%22%3A%7B%7D%2C%22credentials%22%3A%7B%7D%2C%22keyboard%22%3A%7B%7D%2C%22locks%22%3A%7B%7D%2C%22mediaDevices%22%3A%7B%7D%2C%22serviceWorker%22%3A%7B%7D%2C%22storage%22%3A%7B%7D%2C%22presentation%22%3A%7B%7D%2C%22usb%22%3A%7B%7D%2C%22xr%22%3A%7B%7D%2C%22plugins%22%3A%5B%22internal-pdf-viewer%22%2C%22mhjfbmdgcfjbbpaeojofohoefgiehjai%22%2C%22internal-nacl-plugin%22%5D%7D%2C%22dr%22%3A%22%22%2C%22wn%22%3A%5B%5B393%2C672%2C1%2C1588533093175%5D%5D%2C%22xy%22%3A%5B%5B0%2C0%2C1%2C1588533093175%5D%5D%2C%22mm%22%3A%5B%5B108%2C19%2C1588533094073%5D%2C%5B124%2C36%2C1588533094079%5D%2C%5B211%2C119%2C1588533094114%5D%2C%5B231%2C137%2C1588533094119%5D%2C%5B248%2C154%2C1588533094128%5D%2C%5B265%2C171%2C1588533094135%5D%2C%5B282%2C189%2C1588533094144%5D%2C%5B298%2C207%2C1588533094151%5D%2C%5B313%2C224%2C1588533094159%5D%2C%5B328%2C239%2C1588533094167%5D%2C%5B342%2C252%2C1588533094175%5D%2C%5B355%2C263%2C1588533094183%5D%2C%5B367%2C272%2C1588533094191%5D%2C%5B377%2C279%2C1588533094200%5D%2C%5B383%2C283%2C1588533094207%5D%2C%5B377%2C336%2C1588533165183%5D%2C%5B353%2C322%2C1588533165191%5D%2C%5B332%2C308%2C1588533165199%5D%2C%5B313%2C294%2C1588533165208%5D%2C%5B296%2C281%2C1588533165214%5D%2C%5B280%2C267%2C1588533165222%5D%2C%5B265%2C252%2C1588533165230%5D%2C%5B251%2C238%2C1588533165238%5D%2C%5B239%2C224%2C1588533165247%5D%2C%5B228%2C211%2C1588533165254%5D%2C%5B219%2C199%2C1588533165263%5D%2C%5B212%2C187%2C1588533165270%5D%2C%5B206%2C177%2C1588533165279%5D%2C%5B200%2C168%2C1588533165286%5D%2C%5B194%2C159%2C1588533165295%5D%2C%5B189%2C150%2C1588533165302%5D%2C%5B184%2C142%2C1588533165311%5D%2C%5B179%2C134%2C1588533165318%5D%2C%5B175%2C127%2C1588533165326%5D%2C%5B171%2C121%2C1588533165334%5D%2C%5B167%2C115%2C1588533165342%5D%2C%5B164%2C109%2C1588533165350%5D%2C%5B160%2C103%2C1588533165359%5D%5D%7D%2C%22session%22%3A%5B%5D%2C%22widgetList%22%3A%5Bnull%5D%2C%22widgetId%22%3A%2206wt26onoxp%22%2C%22href%22%3A%22file%3A%2F%2F%2Fhome%2Fmassimo%2FScrivania%2Ftest_hcaptcha.html%22%7D'
        }

        sts, data = self.cm.getPage("https://hcaptcha.com/getcaptcha", self.params, post_data=postData)
        if not sts:
            return

        response = json_loads(data)

        printDBG(str(response))

        token = response.get("generated_pass_UUID", "")

        if token:
            printDBG("----------- hCaptcha already solved! --------------")
            GetIPTVNotify().push(_("hCaptcha already solved!"), 'info', 5)
            return token

        hCaptcha['challengeKey'] = response['key']
        hCaptcha['question'] = html.parser.HTMLParser().unescape(response["requester_question"][lang]).encode('utf-8')
        hCaptcha['tasklist'] = response["tasklist"]

        printDBG(str(hCaptcha))

        # number of images
        hCaptcha['imgNumber'] = len(hCaptcha['tasklist'])

        # if hCaptcha['imgNumber'] > 18:
        #    GetIPTVNotify().push(_("hCaptcha with more than 18 images are not supported yet!"), 'info', 5)
        #    return ""

        # get images
        n_img = 0
        for t in hCaptcha['tasklist']:
            printDBG("------------> task: url \"%s\" - key \"%s\"" % (t["datapoint_uri"], t["task_key"]))

            img_params = {'maintype': 'image', 'subtypes': ['jpeg'], 'check_first_bytes': [b'\xFF\xD8', b'\xFF\xD9']}
            filePath = GetTmpDir('.iptvplayer_hcaptcha_%d.jpg' % n_img)
            n_img = n_img + 1
            ret = self.cm.saveWebFile(filePath, t["datapoint_uri"], img_params)
            if not ret.get('sts'):
                SetIPTVPlayerLastHostError(_('Fail to get "%s".') % t["datapoint_uri"])
                break

        # call hcpatcha widget
        startTime = int(time.time() * 1000)
        retArg = self.sessionEx.waitForFinishOpen(UnCaptchahCaptchaWidget, hCaptcha=hCaptcha)

        printDBG("Start time: %s " % startTime)
        printDBG('>>>>>>>> Captcha response[%s]' % (retArg))

        if retArg is not None and len(retArg) and retArg[0]:
            answer = retArg[0]
            printDBG('>>>>>>>> Captcha answer[%s]' % (answer))

            # create post data for check
            # example_
            # https://hcaptcha.com/checkcaptcha/%challenge-key%
            # POST con parametri:
            # {#
            #   "job_mode":"image_label_binary",
            #   "answers":{
            #       "a255c5c8-70c7-4cbe-a84a-e5d3d3ac7797":"true",   # [img-key], "true"/"false"
            #       "3794d2b3-0807-4d72-89be-e7c5f85beedd":"false",
            #       "6aa5789d-4da4-407f-b89e-57193553c6f1":"false",
            #       "5757a175-162d-4b0a-a53c-aa6eeace0c95":"true",
            #       "abc48e33-4e00-40e3-a671-bbb308d3f592":"false",
            #       "1d1f2826-7958-4c3f-9302-78b44fcd25e1":"false",
            #       "37051dd2-ff3c-44ed-a22a-3e51520a6f30":"true",
            #       "124a9f8e-070d-4e98-84d4-b0f21b41c616":"false",
            #       "90f69022-1ff7-43bf-8b9d-dbe1fdcc32a6":"false"
            #   },
            #   "serverdomain":"www.hcaptcha.com",
            #   "sitekey": %site-key%,
            #   "motionData":"{\"st\":1588536562146,\"dct\":1588536562146,\"mm\":[[56,480,1588536562254],[55,480,1588536562324],[54,480,1588536562333],[52,479,1588536562342],[51,478,1588536562351],[50,477,1588536562356],[49,478,1588536575783],[44,477,1588536575783],[38,476,1588536575789],[32,474,1588536575797],[27,472,1588536575804],[23,470,1588536575812],[19,468,1588536575820],[17,467,1588536575828],[16,467,1588536575844],[19,468,1588536576012],[22,469,1588536576020],[26,471,1588536576028],[29,472,1588536576036],[33,473,1588536576044],[35,475,1588536576053],[37,476,1588536576060],[38,477,1588536576069],[40,478,1588536576076],[41,479,1588536576086],[41,480,1588536576102],[42,482,1588536576135],[43,485,1588536576149],[45,486,1588536576157],[46,488,1588536576165],[48,490,1588536576172],[50,492,1588536576181],[52,493,1588536576188],[53,495,1588536576196],[55,496,1588536576204],[57,497,1588536576212],[58,498,1588536576221],[59,499,1588536576228],[59,500,1588536576244],[60,502,1588536576260],[62,503,1588536576276],[65,504,1588536576892],[66,504,1588536576900],[67,504,1588536576908],[70,505,1588536576917],[72,506,1588536576924],[73,506,1588536576934],[76,506,1588536576940],[79,506,1588536576951],[83,506,1588536576956],[88,506,1588536576968],[94,505,1588536576972],[99,504,1588536576981],[103,504,1588536576988],[109,503,1588536576996],[113,502,1588536577004],[116,501,1588536577012],[119,500,1588536577020],[122,499,1588536577028],[123,499,1588536577036],[125,498,1588536577044],[127,497,1588536577052],[128,496,1588536577060],[131,495,1588536577068],[135,493,1588536577076],[141,490,1588536577086],[147,487,1588536577092],[152,483,1588536577101],[157,480,1588536577108],[162,477,1588536577117],[167,474,1588536577124],[172,471,1588536577133],[175,469,1588536577140],[177,467,1588536577152],[179,465,1588536577156],[180,464,1588536577167],[181,464,1588536577317],[185,464,1588536577324],[192,463,1588536577333],[198,461,1588536577340],[206,459,1588536577350],[213,457,1588536577356],[220,454,1588536577366],[226,450,1588536577372],[232,446,1588536577384],[239,442,1588536577388],[247,438,1588536577401],[256,434,1588536577405],[266,430,1588536577411],[277,425,1588536577420],[287,420,1588536577428],[297,416,1588536577437],[307,412,1588536577444],[303,367,1588536585012],[295,367,1588536585021],[286,367,1588536585028],[278,367,1588536585035],[270,366,1588536585044],[263,364,1588536585052],[256,362,1588536585060],[249,358,1588536585068],[242,354,1588536585076],[235,349,1588536585084],[228,343,1588536585092],[221,337,1588536585100],[213,331,1588536585108],[205,324,1588536585116],[197,317,1588536585125],[188,310,1588536585132],[180,304,1588536585141],[172,298,1588536585147],[164,292,1588536585158],[157,286,1588536585164],[149,281,1588536585172],[142,276,1588536585180],[135,271,1588536585190],[127,268,1588536585196],[120,264,1588536585208],[113,261,1588536585212],[107,259,1588536585223],[101,257,1588536585228],[97,255,1588536585236],[94,253,1588536585244],[91,252,1588536585252],[89,251,1588536585260],[87,250,1588536585268],[84,248,1588536585276],[82,247,1588536585283],[79,246,1588536585293],[77,244,1588536585299],[74,242,1588536585309],[71,240,1588536585316],[68,238,1588536585324],[65,236,1588536585332],[62,234,1588536585340],[59,232,1588536585347],[57,230,1588536585356],[55,228,1588536585364],[53,226,1588536585372],[51,223,1588536585380],[50,221,1588536585388],[49,219,1588536585396],[48,217,1588536585412],[47,216,1588536585425],[47,215,1588536585516],[47,214,1588536585564],[47,213,1588536585572],[47,212,1588536585676],[47,211,1588536585692],[48,210,1588536585700],[48,209,1588536585732],[49,207,1588536585740],[50,208,1588536586580],[51,208,1588536586612],[53,209,1588536586628],[55,210,1588536586639],[57,212,1588536586644],[60,215,1588536586655],[63,217,1588536586660],[66,220,1588536586668],[68,224,1588536586677],[70,228,1588536586683],[72,232,1588536586692],[73,236,1588536586700],[75,240,1588536586708],[76,245,1588536586716],[77,249,1588536586724],[78,253,1588536586732],[79,258,1588536586740],[79,260,1588536586748],[79,264,1588536586757],[79,267,1588536586764],[79,269,1588536586773],[79,271,1588536586780],[79,272,1588536586789],[79,273,1588536586796],[79,275,1588536586804],[79,276,1588536586812],[79,277,1588536586822],[79,278,1588536586828],[79,279,1588536586856],[78,281,1588536586860],[77,282,1588536586870],[76,284,1588536586876],[76,285,1588536586884],[75,287,1588536586892],[74,288,1588536586900],[73,290,1588536586908],[72,291,1588536586916],[71,292,1588536586924],[70,293,1588536586932],[69,294,1588536586948],[67,295,1588536586973],[66,296,1588536586989],[66,297,1588536587605],[66,298,1588536587612],[66,299,1588536587621],[66,301,1588536587628],[66,303,1588536587638],[66,306,1588536587644],[67,310,1588536587654],[67,313,1588536587660],[68,319,1588536587671],[69,324,1588536587676],[69,328,1588536587687],[70,334,1588536587692],[71,339,1588536587701],[71,345,1588536587708],[71,351,1588536587716],[71,357,1588536587724],[71,363,1588536587732],[71,368,1588536587740],[71,374,1588536587747],[71,380,1588536587756],[70,387,1588536587764],[68,393,1588536587772],[67,399,1588536587780],[66,404,1588536587789],[65,408,1588536587796],[64,411,1588536587804],[64,412,1588536587821],[64,411,1588536588004],[64,409,1588536588012],[64,408,1588536588020],[64,407,1588536588028],[64,406,1588536588037],[64,404,1588536588044],[64,402,1588536588053],[65,399,1588536588060],[66,397,1588536588070],[66,396,1588536588076],[66,395,1588536588087],[66,394,1588536588092],[66,393,1588536588104],[65,393,1588536589180],[64,393,1588536592063],[61,392,1588536592063],[59,392,1588536592076],[58,392,1588536592084],[57,391,1588536592133],[60,391,1588536592149],[63,391,1588536592156],[66,391,1588536592165],[68,391,1588536592172],[70,391,1588536592181],[72,391,1588536592188],[74,391,1588536592199],[75,391,1588536592204],[76,391,1588536592213],[78,390,1588536592404],[81,388,1588536592414],[86,387,1588536592420],[93,385,1588536592429],[101,383,1588536592436],[112,379,1588536592444],[125,374,1588536592452],[141,369,1588536592460],[158,365,1588536592468],[177,361,1588536592476],[197,356,1588536592484],[220,352,1588536592492],[242,348,1588536592500],[263,344,1588536592508],[283,339,1588536592516],[303,334,1588536592524],[309,475,1588536597126],[306,477,1588536597132],[303,478,1588536597143],[301,480,1588536597148],[298,481,1588536597160],[297,482,1588536597164],[296,482,1588536597180],[295,482,1588536597188],[294,482,1588536597204],[293,482,1588536597212],[292,482,1588536597220],[291,482,1588536597236],[290,482,1588536597245],[288,482,1588536597251],[287,482,1588536597260],[285,481,1588536597267],[284,481,1588536597308],[283,481,1588536597316],[282,480,1588536597325],[281,480,1588536597396],[280,479,1588536597412],[280,478,1588536597484],[280,477,1588536597559],[280,476,1588536597612],[280,475,1588536597652],[280,474,1588536597676],[280,473,1588536597684],[280,472,1588536597692],[280,471,1588536597709],[280,470,1588536597748],[279,469,1588536597884],[279,470,1588536597900],[278,472,1588536597908],[277,473,1588536597916],[276,474,1588536597943],[276,475,1588536597959],[275,476,1588536597975],[274,477,1588536597992],[273,478,1588536597996],[272,479,1588536598004],[270,480,1588536598012],[268,481,1588536598020],[267,481,1588536598036],[268,481,1588536598452],[269,481,1588536598477],[270,481,1588536598484]],\"md\":[[49,207,1588536585814],[66,296,1588536587142],[66,393,1588536588654],[267,481,1588536598397]],\"mu\":[[49,207,1588536585932],[66,296,1588536587271],[66,393,1588536588764],[270,481,1588536598613]],\"topLevel\":{\"mm\":[[401,4307,1588536555028],[411,4303,1588536555036],[421,4299,1588536555046],[431,4295,1588536555052],[440,4292,1588536555059],[448,4288,1588536555068],[454,4285,1588536555078],[461,4282,1588536555089],[467,4280,1588536555094],[472,4278,1588536555100],[470,4132,1588536560854],[463,4142,1588536560860],[455,4151,1588536560870],[447,4160,1588536560876],[437,4168,1588536560886],[427,4177,1588536560892],[417,4186,1588536560903],[407,4194,1588536560908],[408,4256,1588536577452],[417,4252,1588536577460],[426,4248,1588536577468],[435,4243,1588536577476],[445,4238,1588536577484],[455,4234,1588536577492],[465,4229,1588536577500],[466,4212,1588536584748],[459,4214,1588536584758],[453,4215,1588536584764],[447,4216,1588536584774],[443,4216,1588536584780],[439,4216,1588536584792],[436,4216,1588536584796],[434,4216,1588536584808],[433,4216,1588536584812],[432,4215,1588536584884],[431,4215,1588536584941],[430,4215,1588536584948],[428,4215,1588536584957],[425,4215,1588536584964],[422,4215,1588536584975],[419,4215,1588536584980],[414,4215,1588536584990],[408,4215,1588536584996],[402,4215,1588536585007],[411,4178,1588536592532],[427,4175,1588536592539],[441,4171,1588536592548],[453,4167,1588536592555],[463,4164,1588536592564],[470,4161,1588536592572],[473,4196,1588536596773],[472,4199,1588536596781],[471,4203,1588536596787],[469,4206,1588536596796],[467,4210,1588536596804],[465,4213,1588536596812],[463,4217,1588536596820],[461,4221,1588536596828],[459,4224,1588536596835],[457,4227,1588536596844],[456,4230,1588536596852],[454,4233,1588536596860],[452,4235,1588536596868],[451,4238,1588536596876],[449,4241,1588536596884],[447,4244,1588536596893],[445,4247,1588536596900],[443,4251,1588536596909],[441,4255,1588536596916],[439,4259,1588536596926],[437,4263,1588536596931],[436,4267,1588536596943],[434,4271,1588536596948],[433,4274,1588536596960],[432,4278,1588536596964],[431,4281,1588536596972],[429,4284,1588536596980],[428,4287,1588536596988],[427,4289,1588536596996],[426,4292,1588536597004],[425,4294,1588536597012],[424,4296,1588536597020],[422,4298,1588536597028],[421,4300,1588536597036],[419,4303,1588536597044],[417,4305,1588536597052],[416,4308,1588536597060],[414,4310,1588536597067],[412,4313,1588536597077],[411,4315,1588536597084],[409,4317,1588536597092],[407,4319,1588536597100],[405,4320,1588536597110],[403,4321,1588536597116]]}}"
            # }
            check_url = "https://hcaptcha.com/checkcaptcha/%s" % hCaptcha['challengeKey']

            check_post_data = {"job_mode": "image_label_binary"}
            # "motionData":"{\"st\":1588536562146,\"dct\":1588536562146,\"mm\":[[56,480,1588536562254],[55,480,1588536562324],[54,480,1588536562333],[52,479,1588536562342],[51,478,1588536562351],[50,477,1588536562356],[49,478,1588536575783],[44,477,1588536575783],[38,476,1588536575789],[32,474,1588536575797],[27,472,1588536575804],[23,470,1588536575812],[19,468,1588536575820],[17,467,1588536575828],[16,467,1588536575844],[19,468,1588536576012],[22,469,1588536576020],[26,471,1588536576028],[29,472,1588536576036],[33,473,1588536576044],[35,475,1588536576053],[37,476,1588536576060],[38,477,1588536576069],[40,478,1588536576076],[41,479,1588536576086],[41,480,1588536576102],[42,482,1588536576135],[43,485,1588536576149],[45,486,1588536576157],[46,488,1588536576165],[48,490,1588536576172],[50,492,1588536576181],[52,493,1588536576188],[53,495,1588536576196],[55,496,1588536576204],[57,497,1588536576212],[58,498,1588536576221],[59,499,1588536576228],[59,500,1588536576244],[60,502,1588536576260],[62,503,1588536576276],[65,504,1588536576892],[66,504,1588536576900],[67,504,1588536576908],[70,505,1588536576917],[72,506,1588536576924],[73,506,1588536576934],[76,506,1588536576940],[79,506,1588536576951],[83,506,1588536576956],[88,506,1588536576968],[94,505,1588536576972],[99,504,1588536576981],[103,504,1588536576988],[109,503,1588536576996],[113,502,1588536577004],[116,501,1588536577012],[119,500,1588536577020],[122,499,1588536577028],[123,499,1588536577036],[125,498,1588536577044],[127,497,1588536577052],[128,496,1588536577060],[131,495,1588536577068],[135,493,1588536577076],[141,490,1588536577086],[147,487,1588536577092],[152,483,1588536577101],[157,480,1588536577108],[162,477,1588536577117],[167,474,1588536577124],[172,471,1588536577133],[175,469,1588536577140],[177,467,1588536577152],[179,465,1588536577156],[180,464,1588536577167],[181,464,1588536577317],[185,464,1588536577324],[192,463,1588536577333],[198,461,1588536577340],[206,459,1588536577350],[213,457,1588536577356],[220,454,1588536577366],[226,450,1588536577372],[232,446,1588536577384],[239,442,1588536577388],[247,438,1588536577401],[256,434,1588536577405],[266,430,1588536577411],[277,425,1588536577420],[287,420,1588536577428],[297,416,1588536577437],[307,412,1588536577444],[303,367,1588536585012],[295,367,1588536585021],[286,367,1588536585028],[278,367,1588536585035],[270,366,1588536585044],[263,364,1588536585052],[256,362,1588536585060],[249,358,1588536585068],[242,354,1588536585076],[235,349,1588536585084],[228,343,1588536585092],[221,337,1588536585100],[213,331,1588536585108],[205,324,1588536585116],[197,317,1588536585125],[188,310,1588536585132],[180,304,1588536585141],[172,298,1588536585147],[164,292,1588536585158],[157,286,1588536585164],[149,281,1588536585172],[142,276,1588536585180],[135,271,1588536585190],[127,268,1588536585196],[120,264,1588536585208],[113,261,1588536585212],[107,259,1588536585223],[101,257,1588536585228],[97,255,1588536585236],[94,253,1588536585244],[91,252,1588536585252],[89,251,1588536585260],[87,250,1588536585268],[84,248,1588536585276],[82,247,1588536585283],[79,246,1588536585293],[77,244,1588536585299],[74,242,1588536585309],[71,240,1588536585316],[68,238,1588536585324],[65,236,1588536585332],[62,234,1588536585340],[59,232,1588536585347],[57,230,1588536585356],[55,228,1588536585364],[53,226,1588536585372],[51,223,1588536585380],[50,221,1588536585388],[49,219,1588536585396],[48,217,1588536585412],[47,216,1588536585425],[47,215,1588536585516],[47,214,1588536585564],[47,213,1588536585572],[47,212,1588536585676],[47,211,1588536585692],[48,210,1588536585700],[48,209,1588536585732],[49,207,1588536585740],[50,208,1588536586580],[51,208,1588536586612],[53,209,1588536586628],[55,210,1588536586639],[57,212,1588536586644],[60,215,1588536586655],[63,217,1588536586660],[66,220,1588536586668],[68,224,1588536586677],[70,228,1588536586683],[72,232,1588536586692],[73,236,1588536586700],[75,240,1588536586708],[76,245,1588536586716],[77,249,1588536586724],[78,253,1588536586732],[79,258,1588536586740],[79,260,1588536586748],[79,264,1588536586757],[79,267,1588536586764],[79,269,1588536586773],[79,271,1588536586780],[79,272,1588536586789],[79,273,1588536586796],[79,275,1588536586804],[79,276,1588536586812],[79,277,1588536586822],[79,278,1588536586828],[79,279,1588536586856],[78,281,1588536586860],[77,282,1588536586870],[76,284,1588536586876],[76,285,1588536586884],[75,287,1588536586892],[74,288,1588536586900],[73,290,1588536586908],[72,291,1588536586916],[71,292,1588536586924],[70,293,1588536586932],[69,294,1588536586948],[67,295,1588536586973],[66,296,1588536586989],[66,297,1588536587605],[66,298,1588536587612],[66,299,1588536587621],[66,301,1588536587628],[66,303,1588536587638],[66,306,1588536587644],[67,310,1588536587654],[67,313,1588536587660],[68,319,1588536587671],[69,324,1588536587676],[69,328,1588536587687],[70,334,1588536587692],[71,339,1588536587701],[71,345,1588536587708],[71,351,1588536587716],[71,357,1588536587724],[71,363,1588536587732],[71,368,1588536587740],[71,374,1588536587747],[71,380,1588536587756],[70,387,1588536587764],[68,393,1588536587772],[67,399,1588536587780],[66,404,1588536587789],[65,408,1588536587796],[64,411,1588536587804],[64,412,1588536587821],[64,411,1588536588004],[64,409,1588536588012],[64,408,1588536588020],[64,407,1588536588028],[64,406,1588536588037],[64,404,1588536588044],[64,402,1588536588053],[65,399,1588536588060],[66,397,1588536588070],[66,396,1588536588076],[66,395,1588536588087],[66,394,1588536588092],[66,393,1588536588104],[65,393,1588536589180],[64,393,1588536592063],[61,392,1588536592063],[59,392,1588536592076],[58,392,1588536592084],[57,391,1588536592133],[60,391,1588536592149],[63,391,1588536592156],[66,391,1588536592165],[68,391,1588536592172],[70,391,1588536592181],[72,391,1588536592188],[74,391,1588536592199],[75,391,1588536592204],[76,391,1588536592213],[78,390,1588536592404],[81,388,1588536592414],[86,387,1588536592420],[93,385,1588536592429],[101,383,1588536592436],[112,379,1588536592444],[125,374,1588536592452],[141,369,1588536592460],[158,365,1588536592468],[177,361,1588536592476],[197,356,1588536592484],[220,352,1588536592492],[242,348,1588536592500],[263,344,1588536592508],[283,339,1588536592516],[303,334,1588536592524],[309,475,1588536597126],[306,477,1588536597132],[303,478,1588536597143],[301,480,1588536597148],[298,481,1588536597160],[297,482,1588536597164],[296,482,1588536597180],[295,482,1588536597188],[294,482,1588536597204],[293,482,1588536597212],[292,482,1588536597220],[291,482,1588536597236],[290,482,1588536597245],[288,482,1588536597251],[287,482,1588536597260],[285,481,1588536597267],[284,481,1588536597308],[283,481,1588536597316],[282,480,1588536597325],[281,480,1588536597396],[280,479,1588536597412],[280,478,1588536597484],[280,477,1588536597559],[280,476,1588536597612],[280,475,1588536597652],[280,474,1588536597676],[280,473,1588536597684],[280,472,1588536597692],[280,471,1588536597709],[280,470,1588536597748],[279,469,1588536597884],[279,470,1588536597900],[278,472,1588536597908],[277,473,1588536597916],[276,474,1588536597943],[276,475,1588536597959],[275,476,1588536597975],[274,477,1588536597992],[273,478,1588536597996],[272,479,1588536598004],[270,480,1588536598012],[268,481,1588536598020],[267,481,1588536598036],[268,481,1588536598452],[269,481,1588536598477],[270,481,1588536598484]],\"md\":[[49,207,1588536585814],[66,296,1588536587142],[66,393,1588536588654],[267,481,1588536598397]],\"mu\":[[49,207,1588536585932],[66,296,1588536587271],[66,393,1588536588764],[270,481,1588536598613]],\"topLevel\":{\"mm\":[[401,4307,1588536555028],[411,4303,1588536555036],[421,4299,1588536555046],[431,4295,1588536555052],[440,4292,1588536555059],[448,4288,1588536555068],[454,4285,1588536555078],[461,4282,1588536555089],[467,4280,1588536555094],[472,4278,1588536555100],[470,4132,1588536560854],[463,4142,1588536560860],[455,4151,1588536560870],[447,4160,1588536560876],[437,4168,1588536560886],[427,4177,1588536560892],[417,4186,1588536560903],[407,4194,1588536560908],[408,4256,1588536577452],[417,4252,1588536577460],[426,4248,1588536577468],[435,4243,1588536577476],[445,4238,1588536577484],[455,4234,1588536577492],[465,4229,1588536577500],[466,4212,1588536584748],[459,4214,1588536584758],[453,4215,1588536584764],[447,4216,1588536584774],[443,4216,1588536584780],[439,4216,1588536584792],[436,4216,1588536584796],[434,4216,1588536584808],[433,4216,1588536584812],[432,4215,1588536584884],[431,4215,1588536584941],[430,4215,1588536584948],[428,4215,1588536584957],[425,4215,1588536584964],[422,4215,1588536584975],[419,4215,1588536584980],[414,4215,1588536584990],[408,4215,1588536584996],[402,4215,1588536585007],[411,4178,1588536592532],[427,4175,1588536592539],[441,4171,1588536592548],[453,4167,1588536592555],[463,4164,1588536592564],[470,4161,1588536592572],[473,4196,1588536596773],[472,4199,1588536596781],[471,4203,1588536596787],[469,4206,1588536596796],[467,4210,1588536596804],[465,4213,1588536596812],[463,4217,1588536596820],[461,4221,1588536596828],[459,4224,1588536596835],[457,4227,1588536596844],[456,4230,1588536596852],[454,4233,1588536596860],[452,4235,1588536596868],[451,4238,1588536596876],[449,4241,1588536596884],[447,4244,1588536596893],[445,4247,1588536596900],[443,4251,1588536596909],[441,4255,1588536596916],[439,4259,1588536596926],[437,4263,1588536596931],[436,4267,1588536596943],[434,4271,1588536596948],[433,4274,1588536596960],[432,4278,1588536596964],[431,4281,1588536596972],[429,4284,1588536596980],[428,4287,1588536596988],[427,4289,1588536596996],[426,4292,1588536597004],[425,4294,1588536597012],[424,4296,1588536597020],[422,4298,1588536597028],[421,4300,1588536597036],[419,4303,1588536597044],[417,4305,1588536597052],[416,4308,1588536597060],[414,4310,1588536597067],[412,4313,1588536597077],[411,4315,1588536597084],[409,4317,1588536597092],[407,4319,1588536597100],[405,4320,1588536597110],[403,4321,1588536597116]]}}"}

            check_post_data['sitekey'] = hCaptcha['sitekey']
            check_post_data['serverdomain'] = hCaptcha["domain"]
            check_post_data['c'] = "null"
            check_post_data['n'] = None
            # check_post_data['serverdomain'] = "guardaserie.band"

            motion_data = {"st": startTime, "dct": startTime}
            mm = [
            [6, 342, 2028 + startTime],
            [23, 342, 2032 + startTime],
            [37, 342, 2042 + startTime],
            [48, 342, 2052 + startTime],
            [56, 342, 2062 + startTime],
            [62, 342, 2071 + startTime],
            [66, 342, 2081 + startTime],
            [68, 342, 2091 + startTime],
            [69, 342, 2100 + startTime],
            [70, 342, 2110 + startTime],
            [70, 342, 2120 + startTime],
            [70, 342, 2131 + startTime],
            [71, 342, 2140 + startTime],
            [71, 341, 2333 + startTime],
            [71, 337, 2342 + startTime],
            [71, 324, 2350 + startTime],
            [71, 310, 2358 + startTime],
            [72, 297, 2367 + startTime],
            [76, 286, 2376 + startTime],
            [78, 278, 2386 + startTime],
            [81, 272, 2396 + startTime],
            [82, 268, 2406 + startTime],
            [83, 266, 2415 + startTime],
            [83, 265, 2427 + startTime],
            [83, 264, 2439 + startTime],
            [84, 264, 2449 + startTime],
            [84, 264, 2459 + startTime],
            [85, 264, 2470 + startTime],
            [85, 264, 3625 + startTime],
            [87, 264, 3634 + startTime],
            [90, 264, 3644 + startTime],
            [94, 264, 3653 + startTime],
            [99, 264, 3664 + startTime],
            [105, 264, 3673 + startTime],
            [110, 264, 3683 + startTime],
            [115, 264, 3697 + startTime],
            [119, 264, 3702 + startTime],
            [124, 264, 3713 + startTime],
            [129, 264, 3722 + startTime],
            [133, 264, 3732 + startTime],
            [137, 264, 3742 + startTime],
            [139, 264, 3751 + startTime],
            [141, 264, 3762 + startTime],
            [142, 264, 3772 + startTime],
            [143, 264, 3781 + startTime],
            [144, 264, 3791 + startTime],
            [144, 264, 3801 + startTime],
            [145, 264, 3810 + startTime],
            [146, 264, 3822 + startTime],
            [146, 264, 3830 + startTime],
            [147, 264, 3841 + startTime],
            [147, 264, 3850 + startTime],
            [148, 264, 3860 + startTime],
            [149, 264, 3870 + startTime],
            [149, 264, 3880 + startTime],
            [150, 264, 3890 + startTime],
            [150, 264, 3899 + startTime],
            [151, 264, 3909 + startTime],
            [151, 264, 4109 + startTime],
            [154, 264, 4117 + startTime],
            [158, 265, 4127 + startTime],
            [166, 265, 4135 + startTime],
            [173, 266, 4145 + startTime],
            [181, 267, 4155 + startTime],
            [188, 267, 4165 + startTime],
            [194, 267, 4175 + startTime],
            [198, 268, 4184 + startTime],
            [202, 269, 4194 + startTime],
            [203, 269, 4205 + startTime],
            [204, 269, 4214 + startTime],
            [205, 269, 4224 + startTime],
            [205, 269, 4233 + startTime],
            [206, 270, 4244 + startTime],
            [209, 270, 4896 + startTime],
            [218, 270, 4904 + startTime],
            [239, 270, 4913 + startTime],
            [258, 270, 4922 + startTime],
            [277, 270, 4932 + startTime],
            [294, 270, 4942 + startTime],
            [309, 270, 4951 + startTime],
            [323, 270, 4961 + startTime],
            [335, 270, 4971 + startTime],
            [343, 270, 4981 + startTime],
            [349, 271, 4991 + startTime],
            [352, 271, 5000 + startTime],
            [353, 271, 5010 + startTime],
            [354, 272, 5021 + startTime],
            [355, 272, 5030 + startTime],
            [355, 272, 5039 + startTime],
            [356, 272, 5049 + startTime],
            [356, 272, 5060 + startTime],
            [356, 272, 5070 + startTime],
            [357, 272, 5079 + startTime],
            [357, 272, 5088 + startTime],
            [357, 272, 5099 + startTime],
            [357, 272, 5109 + startTime],
            [357, 272, 5119 + startTime],
            [358, 272, 5128 + startTime],
            [358, 272, 5138 + startTime],
            [358, 272, 5148 + startTime],
            [358, 272, 5177 + startTime],
            [358, 272, 5237 + startTime],
            [358, 272, 5246 + startTime],
            [359, 272, 5256 + startTime],
            [357, 273, 5887 + startTime],
            [349, 281, 5895 + startTime],
            [332, 294, 5905 + startTime],
            [315, 306, 5915 + startTime],
            [299, 318, 5925 + startTime],
            [282, 328, 5934 + startTime],
            [266, 336, 5944 + startTime],
            [251, 344, 5955 + startTime],
            [236, 351, 5964 + startTime],
            [224, 357, 5974 + startTime],
            [213, 364, 5983 + startTime],
            [203, 370, 5993 + startTime],
            [196, 374, 6004 + startTime],
            [189, 379, 6012 + startTime],
            [183, 382, 6023 + startTime],
            [178, 386, 6032 + startTime],
            [174, 389, 6043 + startTime],
            [171, 392, 6052 + startTime],
            [168, 394, 6062 + startTime],
            [165, 395, 6072 + startTime],
            [163, 397, 6082 + startTime],
            [162, 398, 6092 + startTime],
            [161, 399, 6102 + startTime],
            [159, 399, 6111 + startTime],
            [159, 400, 6122 + startTime],
            [158, 400, 6131 + startTime],
            [158, 401, 6141 + startTime],
            [157, 401, 6150 + startTime],
            [156, 402, 6161 + startTime],
            [155, 402, 6170 + startTime],
            [153, 403, 6180 + startTime],
            [150, 405, 6189 + startTime],
            [147, 406, 6199 + startTime],
            [144, 407, 6211 + startTime],
            [140, 408, 6219 + startTime],
            [136, 409, 6229 + startTime],
            [132, 410, 6238 + startTime],
            [129, 410, 6249 + startTime],
            [127, 410, 6259 + startTime],
            [125, 410, 6269 + startTime],
            [122, 410, 6278 + startTime],
            [120, 410, 6288 + startTime],
            [118, 410, 6298 + startTime],
            [115, 410, 6307 + startTime],
            [112, 410, 6319 + startTime],
            [109, 410, 6327 + startTime],
            [106, 410, 6337 + startTime],
            [103, 410, 6347 + startTime],
            [101, 410, 6356 + startTime],
            [99, 410, 6368 + startTime],
            [99, 410, 6377 + startTime],
            [99, 410, 6386 + startTime],
            [100, 410, 7020 + startTime],
            [102, 410, 7028 + startTime],
            [105, 410, 7036 + startTime],
            [109, 410, 7045 + startTime],
            [113, 410, 7056 + startTime],
            [118, 410, 7064 + startTime],
            [124, 410, 7074 + startTime],
            [131, 410, 7085 + startTime],
            [138, 410, 7094 + startTime],
            [146, 410, 7105 + startTime],
            [154, 410, 7113 + startTime],
            [160, 410, 7124 + startTime],
            [166, 410, 7135 + startTime],
            [173, 410, 7143 + startTime],
            [178, 410, 7153 + startTime],
            [183, 410, 7162 + startTime],
            [187, 410, 7173 + startTime],
            [191, 410, 7184 + startTime],
            [194, 410, 7192 + startTime],
            [197, 410, 7202 + startTime],
            [198, 410, 7211 + startTime],
            [200, 410, 7223 + startTime],
            [201, 410, 7233 + startTime],
            [202, 410, 7241 + startTime],
            [203, 410, 7251 + startTime],
            [204, 410, 7261 + startTime],
            [205, 410, 7272 + startTime],
            [205, 410, 7280 + startTime],
            [206, 410, 7291 + startTime],
            [207, 410, 7301 + startTime],
            [208, 410, 7311 + startTime],
            [210, 410, 7320 + startTime],
            [211, 410, 7330 + startTime],
            [213, 410, 7340 + startTime],
            [215, 410, 7351 + startTime],
            [216, 410, 7359 + startTime],
            [217, 410, 7369 + startTime],
            [218, 410, 7378 + startTime],
            [219, 410, 7389 + startTime],
            [219, 410, 7398 + startTime],
            [220, 410, 7408 + startTime],
            [220, 410, 8083 + startTime],
            [239, 410, 8092 + startTime],
            [274, 410, 8100 + startTime],
            [301, 410, 8109 + startTime],
            [322, 410, 8117 + startTime],
            [336, 410, 8126 + startTime],
            [346, 410, 8137 + startTime],
            [354, 410, 8146 + startTime],
            [360, 410, 8155 + startTime],
            [365, 410, 8166 + startTime],
            [368, 410, 8176 + startTime],
            [370, 410, 8185 + startTime],
            [371, 410, 8195 + startTime],
            [371, 410, 8204 + startTime],
            [372, 410, 8216 + startTime],
            [372, 410, 8225 + startTime],
            [372, 410, 8234 + startTime],
            [369, 413, 8945 + startTime],
            [359, 423, 8954 + startTime],
            [335, 442, 8961 + startTime],
            [310, 459, 8971 + startTime],
            [288, 474, 8982 + startTime],
            [265, 486, 8991 + startTime],
            [246, 495, 9002 + startTime],
            [229, 503, 9010 + startTime],
            [215, 508, 9021 + startTime],
            [202, 512, 9032 + startTime],
            [190, 515, 9040 + startTime],
            [181, 517, 9050 + startTime],
            [174, 518, 9060 + startTime],
            [167, 519, 9071 + startTime],
            [162, 520, 9083 + startTime],
            [158, 520, 9090 + startTime],
            [153, 521, 9099 + startTime],
            [149, 521, 9109 + startTime],
            [145, 521, 9301 + startTime],
            [138, 525, 9308 + startTime],
            [126, 533, 9317 + startTime],
            [108, 544, 9325 + startTime],
            [96, 551, 9335 + startTime],
            [88, 556, 9345 + startTime],
            [82, 559, 9355 + startTime],
            [79, 561, 9365 + startTime],
            [78, 562, 9374 + startTime],
            [77, 562, 9385 + startTime],
            [77, 562, 9394 + startTime],
            [79, 562, 9841 + startTime],
            [85, 562, 9851 + startTime],
            [99, 562, 9858 + startTime],
            [114, 562, 9867 + startTime],
            [132, 562, 9876 + startTime],
            [150, 562, 9886 + startTime],
            [167, 562, 9895 + startTime],
            [180, 562, 9905 + startTime],
            [194, 562, 9915 + startTime],
            [208, 562, 9925 + startTime],
            [221, 562, 9934 + startTime],
            [232, 562, 9944 + startTime],
            [241, 565, 9954 + startTime],
            [250, 567, 9965 + startTime],
            [255, 568, 9974 + startTime],
            [259, 568, 9984 + startTime],
            [261, 568, 9993 + startTime],
            [262, 569, 10004 + startTime],
            [263, 569, 10015 + startTime],
            [264, 569, 10023 + startTime],
            [264, 569, 10033 + startTime],
            [266, 569, 10700 + startTime],
            [274, 569, 10708 + startTime],
            [289, 569, 10717 + startTime],
            [304, 569, 10725 + startTime],
            [322, 569, 10734 + startTime],
            [336, 569, 10742 + startTime],
            [348, 569, 10750 + startTime],
            [357, 569, 10760 + startTime],
            [364, 569, 10770 + startTime],
            [369, 569, 10781 + startTime],
            [373, 569, 10790 + startTime],
            [376, 569, 10800 + startTime],
            [377, 569, 10809 + startTime],
            [378, 569, 10820 + startTime],
            [379, 569, 10830 + startTime],
            [380, 569, 10839 + startTime],
            [380, 569, 10849 + startTime],
            [381, 569, 10859 + startTime],
            [381, 569, 10869 + startTime],
            [381, 569, 10879 + startTime],
            [381, 569, 10888 + startTime],
            [381, 571, 11500 + startTime],
            [381, 576, 11507 + startTime],
            [381, 584, 11518 + startTime],
            [381, 590, 11528 + startTime],
            [382, 596, 11537 + startTime],
            [384, 601, 11547 + startTime],
            [386, 607, 11556 + startTime],
            [388, 613, 11567 + startTime],
            [389, 619, 11577 + startTime],
            [390, 622, 11586 + startTime],
            [391, 626, 11596 + startTime],
            [391, 628, 11605 + startTime],
            [391, 629, 11618 + startTime],
            [392, 630, 11629 + startTime],
            [392, 631, 11639 + startTime],
            [392, 632, 11650 + startTime],
            [392, 633, 11660 + startTime],
            [392, 633, 11670 + startTime],
            [392, 634, 11682 + startTime],
            [392, 634, 11692 + startTime],
            [392, 635, 11700 + startTime],
            [392, 637, 11708 + startTime],
            [392, 639, 11717 + startTime],
            [392, 641, 11725 + startTime],
            [392, 643, 11734 + startTime],
            [392, 646, 11744 + startTime],
            [392, 648, 11754 + startTime],
            [392, 651, 11764 + startTime],
            [392, 654, 11774 + startTime],
            [392, 656, 11783 + startTime],
            [392, 659, 11793 + startTime],
            [392, 662, 11802 + startTime],
            [392, 665, 11813 + startTime],
            [393, 668, 11822 + startTime],
            [394, 671, 11832 + startTime],
            [395, 673, 11842 + startTime],
            [396, 676, 11853 + startTime],
            [397, 678, 11862 + startTime],
            [399, 680, 11872 + startTime],
            [400, 681, 11881 + startTime],
            [401, 682, 11892 + startTime],
            [402, 683, 11901 + startTime],
            [402, 684, 11912 + startTime],
            [402, 685, 11922 + startTime],
            [403, 686, 11932 + startTime],
            [403, 687, 11939 + startTime],
            [404, 688, 11950 + startTime],
            [404, 689, 11959 + startTime],
            [405, 689, 11970 + startTime],
            [405, 690, 11980 + startTime],
            [406, 690, 11989 + startTime],
            [406, 691, 12000 + startTime],
            [406, 691, 12009 + startTime],
            [406, 691, 12019 + startTime],
            [406, 691, 12029 + startTime],
            [406, 691, 12038 + startTime],
            [406, 692, 12049 + startTime],
            [406, 692, 12058 + startTime],
            [406, 692, 12069 + startTime],
            [406, 692, 12107 + startTime],
            [407, 692, 12118 + startTime],
            [407, 693, 12128 + startTime],
            [407, 693, 12136 + startTime],
            [407, 694, 12146 + startTime],
            [407, 694, 12157 + startTime],
            [407, 695, 12167 + startTime],
            [407, 696, 12176 + startTime],
            [407, 697, 12186 + startTime],
            [407, 698, 12196 + startTime],
            [407, 700, 12205 + startTime],
            [407, 701, 12216 + startTime],
            [407, 702, 12225 + startTime],
            [407, 702, 12235 + startTime],
            [407, 703, 12245 + startTime],
            [407, 703, 12254 + startTime],
            [407, 704, 12264 + startTime],
            [407, 704, 12275 + startTime],
            [407, 704, 12285 + startTime]
            ]
            md = [[407, 704, 12568 + startTime]]
            mu = [[407, 704, 12730 + startTime]]

            toplevel = {'topLevel': {"xy": [[0, 73, 0.9769585253456221, startTime + 49]],
                                    "mm": [
                                        [93, 353, 2011 + startTime],
                                        [104, 353, 2015 + startTime],
                                        [119, 353, 2024 + startTime]
                                    ]
                                   }
                     }

            if hCaptcha['imgNumber'] > 9:
                toplevel['topLevel']['mm'].extend([
                    [110, 564, 18421 + startTime],
                    [108, 565, 18429 + startTime],
                    [107, 565, 18438 + startTime],
                    [109, 565, 18710 + startTime],
                    [113, 565, 18718 + startTime]
                ])

                mm.extend([
                [407, 703, 13162 + startTime],
                [403, 701, 13170 + startTime],
                [385, 691, 13179 + startTime],
                [357, 674, 13189 + startTime],
                [328, 653, 13200 + startTime],
                [290, 618, 13210 + startTime],
                [251, 582, 13219 + startTime],
                [212, 545, 13227 + startTime],
                [178, 507, 13238 + startTime],
                [150, 476, 13248 + startTime],
                [128, 455, 13257 + startTime],
                [114, 439, 13268 + startTime],
                [105, 430, 13277 + startTime],
                [103, 425, 13288 + startTime],
                [102, 423, 13297 + startTime],
                [102, 420, 13495 + startTime],
                [102, 414, 13503 + startTime],
                [102, 396, 13513 + startTime],
                [101, 365, 13523 + startTime],
                [93, 335, 13533 + startTime],
                [86, 310, 13543 + startTime],
                [80, 293, 13552 + startTime],
                [75, 280, 13562 + startTime],
                [72, 273, 13573 + startTime],
                [71, 270, 13582 + startTime],
                [70, 269, 13593 + startTime],
                [70, 269, 13601 + startTime],
                [70, 269, 13612 + startTime],
                [75, 269, 14265 + startTime],
                [92, 269, 14274 + startTime],
                [126, 270, 14282 + startTime],
                [171, 270, 14291 + startTime],
                [207, 272, 14300 + startTime],
                [238, 275, 14310 + startTime],
                [263, 277, 14319 + startTime],
                [285, 280, 14330 + startTime],
                [300, 282, 14340 + startTime],
                [309, 283, 14350 + startTime],
                [314, 284, 14359 + startTime],
                [316, 284, 14368 + startTime],
                [317, 285, 14378 + startTime],
                [318, 285, 14389 + startTime],
                [315, 285, 14592 + startTime],
                [309, 285, 14601 + startTime],
                [298, 285, 14608 + startTime],
                [285, 285, 14617 + startTime],
                [272, 285, 14625 + startTime],
                [261, 285, 14635 + startTime],
                [250, 285, 14645 + startTime],
                [242, 285, 14653 + startTime],
                [236, 285, 14664 + startTime],
                [231, 285, 14674 + startTime],
                [229, 285, 14685 + startTime],
                [228, 285, 14696 + startTime],
                [228, 285, 14708 + startTime],
                [227, 285, 14718 + startTime],
                [229, 285, 15150 + startTime],
                [238, 285, 15158 + startTime],
                [254, 285, 15167 + startTime],
                [269, 285, 15175 + startTime],
                [284, 285, 15185 + startTime],
                [299, 285, 15195 + startTime],
                [313, 285, 15204 + startTime],
                [326, 285, 15215 + startTime],
                [335, 285, 15224 + startTime],
                [342, 285, 15235 + startTime],
                [347, 285, 15244 + startTime],
                [351, 285, 15253 + startTime],
                [355, 285, 15264 + startTime],
                [357, 285, 15274 + startTime],
                [358, 285, 15284 + startTime],
                [359, 286, 15292 + startTime],
                [360, 286, 15302 + startTime],
                [360, 286, 15313 + startTime],
                [361, 286, 15324 + startTime],
                [361, 286, 15333 + startTime],
                [362, 286, 15341 + startTime],
                [362, 286, 15352 + startTime],
                [362, 286, 15362 + startTime],
                [362, 286, 15371 + startTime],
                [362, 286, 15382 + startTime],
                [362, 286, 15391 + startTime],
                [363, 286, 15410 + startTime],
                [363, 286, 15420 + startTime],
                [363, 286, 15952 + startTime],
                [356, 290, 15962 + startTime],
                [333, 304, 15971 + startTime],
                [302, 321, 15981 + startTime],
                [267, 338, 15991 + startTime],
                [230, 354, 16002 + startTime],
                [197, 368, 16011 + startTime],
                [171, 377, 16020 + startTime],
                [151, 383, 16030 + startTime],
                [136, 388, 16040 + startTime],
                [125, 391, 16051 + startTime],
                [121, 392, 16060 + startTime],
                [118, 393, 16069 + startTime],
                [117, 393, 16079 + startTime],
                [116, 393, 16090 + startTime],
                [116, 393, 16737 + startTime],
                [119, 393, 16747 + startTime],
                [123, 393, 16758 + startTime],
                [129, 393, 16770 + startTime],
                [134, 393, 16782 + startTime],
                [140, 393, 16792 + startTime],
                [147, 393, 16801 + startTime],
                [155, 393, 16810 + startTime],
                [161, 393, 16818 + startTime],
                [167, 393, 16827 + startTime],
                [172, 394, 16836 + startTime],
                [176, 395, 16846 + startTime],
                [179, 396, 16858 + startTime],
                [181, 397, 16866 + startTime],
                [182, 397, 16875 + startTime],
                [183, 397, 16885 + startTime],
                [183, 397, 16895 + startTime],
                [184, 398, 16906 + startTime],
                [184, 398, 16914 + startTime],
                [185, 398, 16925 + startTime],
                [185, 398, 16934 + startTime],
                [185, 398, 16945 + startTime],
                [185, 398, 16954 + startTime],
                [186, 398, 17536 + startTime],
                [193, 398, 17545 + startTime],
                [208, 398, 17555 + startTime],
                [227, 398, 17565 + startTime],
                [250, 398, 17573 + startTime],
                [275, 398, 17583 + startTime],
                [299, 398, 17593 + startTime],
                [319, 398, 17605 + startTime],
                [335, 398, 17613 + startTime],
                [348, 398, 17622 + startTime],
                [356, 398, 17632 + startTime],
                [360, 398, 17643 + startTime],
                [363, 398, 17652 + startTime],
                [364, 398, 17662 + startTime],
                [365, 398, 17672 + startTime],
                [364, 398, 18276 + startTime],
                [363, 398, 18285 + startTime],
                [360, 398, 18293 + startTime],
                [356, 401, 18302 + startTime],
                [341, 412, 18312 + startTime],
                [311, 430, 18321 + startTime],
                [277, 448, 18330 + startTime],
                [239, 470, 18340 + startTime],
                [192, 490, 18351 + startTime],
                [146, 508, 18360 + startTime],
                [101, 523, 18370 + startTime],
                [65, 535, 18379 + startTime],
                [37, 543, 18390 + startTime],
                [17, 548, 18399 + startTime],
                [4, 552, 18410 + startTime],
                [0, 554, 18722 + startTime],
                [8, 554, 18727 + startTime],
                [18, 554, 18736 + startTime],
                [26, 554, 18744 + startTime],
                [33, 554, 18754 + startTime],
                [38, 554, 18765 + startTime],
                [41, 554, 18778 + startTime],
                [43, 554, 18788 + startTime],
                [44, 554, 18797 + startTime],
                [45, 554, 18808 + startTime],
                [45, 554, 18819 + startTime],
                [46, 554, 18829 + startTime],
                [46, 554, 18839 + startTime],
                [47, 554, 18848 + startTime],
                [47, 554, 18856 + startTime],
                [47, 554, 18864 + startTime],
                [47, 554, 18873 + startTime],
                [47, 554, 18882 + startTime],
                [48, 554, 18910 + startTime],
                [48, 554, 18921 + startTime],
                [48, 554, 18930 + startTime],
                [48, 554, 19260 + startTime],
                [58, 554, 19267 + startTime],
                [81, 554, 19276 + startTime],
                [104, 554, 19284 + startTime],
                [124, 554, 19294 + startTime],
                [140, 554, 19305 + startTime],
                [154, 554, 19313 + startTime],
                [167, 554, 19324 + startTime],
                [179, 554, 19333 + startTime],
                [187, 554, 19343 + startTime],
                [192, 554, 19353 + startTime],
                [196, 554, 19362 + startTime],
                [198, 554, 19373 + startTime],
                [199, 554, 19383 + startTime],
                [199, 554, 19392 + startTime],
                [199, 554, 19403 + startTime],
                [201, 554, 20000 + startTime],
                [208, 554, 20005 + startTime],
                [224, 554, 20013 + startTime],
                [239, 554, 20021 + startTime],
                [257, 554, 20030 + startTime],
                [274, 554, 20040 + startTime],
                [291, 554, 20052 + startTime],
                [305, 556, 20060 + startTime],
                [317, 559, 20071 + startTime],
                [326, 561, 20080 + startTime],
                [333, 563, 20091 + startTime],
                [337, 564, 20100 + startTime],
                [339, 564, 20110 + startTime],
                [340, 564, 20119 + startTime],
                [341, 565, 20130 + startTime],
                [342, 565, 20140 + startTime],
                [343, 565, 20149 + startTime],
                [343, 569, 20752 + startTime],
                [347, 576, 20761 + startTime],
                [353, 589, 20769 + startTime],
                [361, 600, 20778 + startTime],
                [368, 612, 20789 + startTime],
                [376, 624, 20801 + startTime],
                [384, 638, 20810 + startTime],
                [391, 650, 20822 + startTime],
                [396, 660, 20832 + startTime],
                [399, 667, 20842 + startTime],
                [402, 673, 20853 + startTime],
                [404, 676, 20863 + startTime],
                [404, 677, 20874 + startTime],
                [404, 677, 20882 + startTime],
                [404, 677, 21122 + startTime],
                [404, 680, 21132 + startTime],
                [404, 683, 21143 + startTime],
                [404, 686, 21153 + startTime],
                [404, 688, 21162 + startTime],
                [404, 690, 21172 + startTime],
                [404, 691, 21181 + startTime],
                [404, 692, 21192 + startTime],
                [404, 693, 21201 + startTime],
                [404, 693, 21211 + startTime],
                [404, 694, 21220 + startTime],
                [404, 695, 21231 + startTime],
                [404, 697, 21240 + startTime],
                [404, 698, 21250 + startTime],
                [404, 700, 21260 + startTime],
                [404, 701, 21270 + startTime],
                [404, 701, 21279 + startTime],
                [404, 702, 21289 + startTime],
                [404, 703, 21300 + startTime],
                [404, 703, 21309 + startTime],
                [404, 703, 21318 + startTime],
                [404, 704, 21329 + startTime],
                [404, 704, 21339 + startTime],
                [404, 704, 21350 + startTime],
                [404, 704, 21358 + startTime],
                [404, 705, 21368 + startTime],
                [404, 705, 21368 + startTime]
                ])
                md.append([404, 705, 21721 + startTime])
                mu.append([404, 705, 21912 + startTime])

            if hCaptcha['imgNumber'] > 18:
                toplevel['topLevel']['mm'].extend([
                [110, 564, 26671 + startTime],
                [108, 565, 26679 + startTime],
                [107, 565, 26688 + startTime],
                [109, 565, 26960 + startTime]
                ])

                mm.extend([
                [407, 703, 21412 + startTime],
                [403, 701, 21420 + startTime],
                [385, 691, 21429 + startTime],
                [357, 674, 21439 + startTime],
                [328, 653, 21450 + startTime],
                [290, 618, 21460 + startTime],
                [251, 582, 21469 + startTime],
                [212, 545, 21477 + startTime],
                [178, 507, 21488 + startTime],
                [150, 476, 21498 + startTime],
                [128, 455, 21507 + startTime],
                [114, 439, 21518 + startTime],
                [105, 430, 21527 + startTime],
                [103, 425, 21538 + startTime],
                [102, 423, 21547 + startTime],
                [102, 420, 21745 + startTime],
                [102, 414, 21753 + startTime],
                [102, 396, 21763 + startTime],
                [101, 365, 21773 + startTime],
                [93, 335, 21783 + startTime],
                [86, 310, 21793 + startTime],
                [80, 293, 21802 + startTime],
                [75, 280, 21812 + startTime],
                [72, 273, 21823 + startTime],
                [71, 270, 21832 + startTime],
                [70, 269, 21843 + startTime],
                [70, 269, 21851 + startTime],
                [70, 269, 21862 + startTime],
                [75, 269, 22515 + startTime],
                [92, 269, 22524 + startTime],
                [126, 270, 22532 + startTime],
                [171, 270, 22541 + startTime],
                [207, 272, 22550 + startTime],
                [238, 275, 22560 + startTime],
                [263, 277, 22569 + startTime],
                [285, 280, 22580 + startTime],
                [300, 282, 22590 + startTime],
                [309, 283, 22600 + startTime],
                [314, 284, 22609 + startTime],
                [316, 284, 22618 + startTime],
                [317, 285, 22628 + startTime],
                [318, 285, 22639 + startTime],
                [315, 285, 22842 + startTime],
                [309, 285, 22851 + startTime],
                [298, 285, 22858 + startTime],
                [285, 285, 22867 + startTime],
                [272, 285, 22875 + startTime],
                [261, 285, 22885 + startTime],
                [250, 285, 22895 + startTime],
                [242, 285, 22903 + startTime],
                [236, 285, 22914 + startTime],
                [231, 285, 22924 + startTime],
                [229, 285, 22935 + startTime],
                [228, 285, 22946 + startTime],
                [228, 285, 22958 + startTime],
                [227, 285, 22968 + startTime],
                [229, 285, 23400 + startTime],
                [238, 285, 23408 + startTime],
                [254, 285, 23417 + startTime],
                [269, 285, 23425 + startTime],
                [284, 285, 23435 + startTime],
                [299, 285, 23445 + startTime],
                [313, 285, 23454 + startTime],
                [326, 285, 23465 + startTime],
                [335, 285, 23474 + startTime],
                [342, 285, 23485 + startTime],
                [347, 285, 23494 + startTime],
                [351, 285, 23503 + startTime],
                [355, 285, 23514 + startTime],
                [357, 285, 23524 + startTime],
                [358, 285, 23534 + startTime],
                [359, 286, 23542 + startTime],
                [360, 286, 23552 + startTime],
                [360, 286, 23563 + startTime],
                [361, 286, 23574 + startTime],
                [361, 286, 23583 + startTime],
                [362, 286, 23591 + startTime],
                [362, 286, 23602 + startTime],
                [362, 286, 23612 + startTime],
                [362, 286, 23621 + startTime],
                [362, 286, 23632 + startTime],
                [362, 286, 23641 + startTime],
                [363, 286, 23660 + startTime],
                [363, 286, 23670 + startTime],
                [363, 286, 24202 + startTime],
                [356, 290, 24212 + startTime],
                [333, 304, 24221 + startTime],
                [302, 321, 24231 + startTime],
                [267, 338, 24241 + startTime],
                [230, 354, 24252 + startTime],
                [197, 368, 24261 + startTime],
                [171, 377, 24270 + startTime],
                [151, 383, 24280 + startTime],
                [136, 388, 24290 + startTime],
                [125, 391, 24301 + startTime],
                [121, 392, 24310 + startTime],
                [118, 393, 24319 + startTime],
                [117, 393, 24329 + startTime],
                [116, 393, 24340 + startTime],
                [116, 393, 24987 + startTime],
                [119, 393, 24997 + startTime],
                [123, 393, 25008 + startTime],
                [129, 393, 25020 + startTime],
                [134, 393, 25032 + startTime],
                [140, 393, 25042 + startTime],
                [147, 393, 25051 + startTime],
                [155, 393, 25060 + startTime],
                [161, 393, 25068 + startTime],
                [167, 393, 25077 + startTime],
                [172, 394, 25086 + startTime],
                [176, 395, 25096 + startTime],
                [179, 396, 25108 + startTime],
                [181, 397, 25116 + startTime],
                [182, 397, 25125 + startTime],
                [183, 397, 25135 + startTime],
                [183, 397, 25145 + startTime],
                [184, 398, 25156 + startTime],
                [184, 398, 25164 + startTime],
                [185, 398, 25175 + startTime],
                [185, 398, 25184 + startTime],
                [185, 398, 25195 + startTime],
                [185, 398, 25204 + startTime],
                [186, 398, 25786 + startTime],
                [193, 398, 25795 + startTime],
                [208, 398, 25805 + startTime],
                [227, 398, 25815 + startTime],
                [250, 398, 25823 + startTime],
                [275, 398, 25833 + startTime],
                [299, 398, 25843 + startTime],
                [319, 398, 25855 + startTime],
                [335, 398, 25863 + startTime],
                [348, 398, 25872 + startTime],
                [356, 398, 25882 + startTime],
                [360, 398, 25893 + startTime],
                [363, 398, 25902 + startTime],
                [364, 398, 25912 + startTime],
                [365, 398, 25922 + startTime],
                [364, 398, 26526 + startTime],
                [363, 398, 26535 + startTime],
                [360, 398, 26543 + startTime],
                [356, 401, 26552 + startTime],
                [341, 412, 26562 + startTime],
                [311, 430, 26571 + startTime],
                [277, 448, 26580 + startTime],
                [239, 470, 26590 + startTime],
                [192, 490, 26601 + startTime],
                [146, 508, 26610 + startTime],
                [101, 523, 26620 + startTime],
                [65, 535, 26629 + startTime],
                [37, 543, 26640 + startTime],
                [17, 548, 26649 + startTime],
                [4, 552, 26660 + startTime],
                [0, 554, 26972 + startTime],
                [8, 554, 26977 + startTime],
                [18, 554, 26986 + startTime],
                [26, 554, 26994 + startTime],
                [33, 554, 27004 + startTime],
                [38, 554, 27015 + startTime],
                [41, 554, 27028 + startTime],
                [43, 554, 27038 + startTime],
                [44, 554, 27047 + startTime],
                [45, 554, 27058 + startTime],
                [45, 554, 27069 + startTime],
                [46, 554, 27079 + startTime],
                [46, 554, 27089 + startTime],
                [47, 554, 27098 + startTime],
                [47, 554, 27106 + startTime],
                [47, 554, 27114 + startTime],
                [47, 554, 27123 + startTime],
                [47, 554, 27132 + startTime],
                [48, 554, 27160 + startTime],
                [48, 554, 27171 + startTime],
                [48, 554, 27180 + startTime],
                [48, 554, 27510 + startTime],
                [58, 554, 27517 + startTime],
                [81, 554, 27526 + startTime],
                [104, 554, 27534 + startTime],
                [124, 554, 27544 + startTime],
                [140, 554, 27555 + startTime],
                [154, 554, 27563 + startTime],
                [167, 554, 27574 + startTime],
                [179, 554, 27583 + startTime],
                [187, 554, 27593 + startTime],
                [192, 554, 27603 + startTime],
                [196, 554, 27612 + startTime],
                [198, 554, 27623 + startTime],
                [199, 554, 27633 + startTime],
                [199, 554, 27642 + startTime],
                [199, 554, 27653 + startTime],
                [201, 554, 28250 + startTime],
                [208, 554, 28255 + startTime],
                [224, 554, 28263 + startTime],
                [239, 554, 28271 + startTime],
                [257, 554, 28280 + startTime],
                [274, 554, 28290 + startTime],
                [291, 554, 28302 + startTime],
                [305, 556, 28310 + startTime],
                [317, 559, 28321 + startTime],
                [326, 561, 28330 + startTime],
                [333, 563, 28341 + startTime],
                [337, 564, 28350 + startTime],
                [339, 564, 28360 + startTime],
                [340, 564, 28369 + startTime],
                [341, 565, 28380 + startTime],
                [342, 565, 28390 + startTime],
                [343, 565, 28399 + startTime],
                [343, 569, 29002 + startTime],
                [347, 576, 29011 + startTime],
                [353, 589, 29019 + startTime],
                [361, 600, 29028 + startTime],
                [368, 612, 29039 + startTime],
                [376, 624, 29051 + startTime],
                [384, 638, 29060 + startTime],
                [391, 650, 29072 + startTime],
                [396, 660, 29082 + startTime],
                [399, 667, 29092 + startTime],
                [402, 673, 29103 + startTime],
                [404, 676, 29113 + startTime],
                [404, 677, 29124 + startTime],
                [404, 677, 29132 + startTime],
                [404, 677, 29372 + startTime],
                [404, 680, 29382 + startTime],
                [404, 683, 29393 + startTime],
                [404, 686, 29403 + startTime],
                [404, 688, 29412 + startTime],
                [404, 690, 29422 + startTime],
                [404, 691, 29431 + startTime],
                [404, 692, 29442 + startTime],
                [404, 693, 29451 + startTime],
                [404, 693, 29461 + startTime],
                [404, 694, 29470 + startTime],
                [404, 695, 29481 + startTime],
                [404, 697, 29490 + startTime],
                [404, 698, 29500 + startTime],
                [404, 700, 29510 + startTime],
                [404, 701, 29520 + startTime],
                [404, 701, 29529 + startTime],
                [404, 702, 29539 + startTime],
                [404, 703, 29550 + startTime],
                [404, 703, 29559 + startTime],
                [404, 703, 29568 + startTime],
                [404, 704, 29579 + startTime],
                [404, 704, 29589 + startTime],
                [404, 704, 29600 + startTime],
                [404, 704, 29608 + startTime],
                [404, 705, 29618 + startTime],
                [404, 705, 29618 + startTime]
                ])
                md.append([406, 705, 29971 + startTime])
                mu.append([406, 705, 30001 + startTime])

            # motion data clicks array
            md_click = [
            [85, 264, 3162 + startTime],
            [206, 270, 4420 + startTime],
            [359, 272, 5442 + startTime],
            [99, 410, 6622 + startTime],
            [220, 410, 7635 + startTime],
            [372, 410, 8556 + startTime],
            [77, 562, 9559 + startTime],
            [264, 569, 10385 + startTime],
            [381, 569, 11201 + startTime],
            [70, 269, 13924 + startTime],
            [227, 285, 14898 + startTime],
            [363, 286, 15655 + startTime],
            [116, 393, 16450 + startTime],
            [185, 398, 17257 + startTime],
            [365, 398, 17995 + startTime],
            [48, 554, 19046 + startTime],
            [199, 554, 19774 + startTime],
            [343, 565, 20492 + startTime],
            [72, 270, 22174 + startTime],
            [225, 280, 23148 + startTime],
            [360, 286, 23905 + startTime],
            [115, 393, 24700 + startTime],
            [182, 396, 25507 + startTime],
            [363, 396, 26245 + startTime],
            [50, 555, 27296 + startTime],
            [201, 554, 28024 + startTime],
            [346, 560, 28742 + startTime]
            ]
            mu_click = [
            [85, 264, 3273 + startTime],
            [206, 270, 4579 + startTime],
            [359, 272, 5553 + startTime],
            [99, 410, 6731 + startTime],
            [220, 410, 7724 + startTime],
            [372, 410, 8621 + startTime],
            [77, 562, 9643 + startTime],
            [264, 569, 10448 + startTime],
            [381, 569, 11253 + startTime],
            [70, 269, 14006 + startTime],
            [227, 285, 14960 + startTime],
            [363, 286, 15719 + startTime],
            [116, 393, 16524 + startTime],
            [185, 398, 17339 + startTime],
            [365, 398, 18056 + startTime],
            [48, 554, 19120 + startTime],
            [199, 554, 19826 + startTime],
            [343, 565, 20543 + startTime],
            [72, 270, 22204 + startTime],
            [225, 280, 23178 + startTime],
            [360, 286, 23935 + startTime],
            [115, 393, 24730 + startTime],
            [182, 396, 25537 + startTime],
            [363, 396, 26275 + startTime],
            [50, 555, 27326 + startTime],
            [201, 554, 28054 + startTime],
            [346, 560, 28772 + startTime]
            ]
            check_answers = {}
            for n in range(hCaptcha['imgNumber']):
                if n in answer:
                    check_answers[hCaptcha['tasklist'][n]["task_key"]] = "true"
                    # add click in motion data
                    md.append(mu_click[n])
                    mu.append(mu_click[n])
                else:
                    check_answers[hCaptcha['tasklist'][n]["task_key"]] = "false"

            printDBG(str(check_answers))
            check_post_data["answers"] = check_answers

            md.sort(key=lambda x: x[2])
            mu.sort(key=lambda x: x[2])

            motion_data.update({'mm': mm, 'md': md, 'mu': mu})
            motion_data.update(toplevel)

            printDBG("---------- hcaptcha motion data ---------------- ")
            printDBG(json_dumps(motion_data))

            check_post_data['motionData'] = motion_data

            printDBG("---------- hcaptcha ckeck post data ---------------- ")
            printDBG(json_dumps(check_post_data))

            self.params.update({'return_data': True, 'raw_post_data': True})
            self.params['header'].update({'accept': '*/*', 'accept-encoding': 'gzip', 'content-type': 'application/json;charset=UTF-8'})

            printDBG("------------ params -------------" + str(self.params))

            sts, check_data = self.cm.getPage(check_url, self.params, post_data=json_dumps(check_post_data))

            printDBG(check_data)
            # example
            # {"pass": true, "generated_pass_UUID": "F0_eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE1ODg2MjU1MTgsInBkIjoiVUozNVUzSlNBTzcyOVRGSTI1Qkc0MUxPUFdMNExQSlE5MEI4WExZUUhTTkc3R0U5OUpRWFUxMVU3UlYzSTExMk9MRUtFNEc4T1hJM0xCSFNEV1oyVFE0U0M1U0Y2UFQ2TTNIQ1BOM0RFREFaNkVWSllCS1ZIMDRHOEgwSVRSSzBJUjZBRlYwUDAyNVJJNllEMUtXTlpBMlBBOERSMURZMTFNME8zMUI0UkE0WVdZV0ZWVDFZS1pWMTZYMFNJVEpVOFdXVjZCSzFCVTlXNEMxV0Q4Q0kzTjkzOE5MMVBIN01DTE5LVVpRSzFRQ1hKSUVLRE5FUVFXSlhMTzdOMkxDUyJ9.VuqfPd-2LBBILqHE2Jo0VpByaL5iTWTP5RvcA6HPiSI", "expiration": 120}
            response = json_loads(check_data)
            if response.get('pass', False):
                printDBG("----------- hCaptcha solved! --------------")
                GetIPTVNotify().push(_("hCaptcha solved!"), 'info', 5)
                return response["generated_pass_UUID"]

        printDBG("----------- hCaptcha not solved! --------------")
        GetIPTVNotify().push(_("hCaptcha not solved!"), 'info', 5)

        return ""
